package com.service.impl;

import com.mapper.AreaMapper;
import com.pojo.Area;
import com.service.AreaService;
import com.util.Pager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("areaService")
public class AreaServiceImpl implements AreaService {
    @Resource
    private AreaMapper areaMapper;
    @Override
    public Pager<Area> searchByAreaPager(Pager<Area> pager) {
        pager.setTotal(areaMapper.total(pager));
        pager.setRows(areaMapper.searchByAreaPager(pager));
        return pager;
    }

    @Override
    public int del(String id) {
        return areaMapper.del(id);
    }

    @Override
    public int update(Area area) {
        return areaMapper.update(area);
    }

    @Override
    public int add(Area area) {
        return areaMapper.add(area);
    }
}
